package com.cpp.common.enums;

import lombok.Getter;

@Getter
public enum QuestionType {
//    1开放题/2简答题/3单选题/4多选题

    OPEN_QUESTION(1, 0.5,"开放题"),
    SHORT_ANSWER(2,0.1,"简答题"),
    SINGLE_CHOICE(3,0.3,"单选题"),
    MULTIPLE_CHOICE(4,0.1,"多选题");

    private Integer type;
    private Double  scoreWight;
    private String name;

    QuestionType(Integer type,Double scoreWight, String name) {
        this.type = type;
        this.name = name;
        this.scoreWight = scoreWight;
    }
    public static QuestionType getType(Integer type) {
        for (QuestionType value : QuestionType.values()) {
            if (value.getType().equals(type)) {
                return value;
            }
        }
        return null;
    }

}
